package com.zjs.jsp.domain.config;

import lombok.Data;

import java.util.List;

@Data
public class ParamList
{
    private String info;

    private String status;

    private List<data> data;


    public Param toParam() {
        Param p = new Param();
        if (data == null) {
            return null;
        }

        for (com.zjs.jsp.domain.config.data data : data) {
            switch (data.getParCode()) {
                case "DDZHBJ":
                    p.setDDZHBJ(Integer.parseInt(data.getParNum()));
                    break;
                case "DDZHSX":
                    p.setDDZHSX(Integer.parseInt(data.getParNum()));
                    break;
                case "RWZDDD":
                    p.setRWZDDD(Integer.parseInt(data.getParNum()));
                    break;
                case "ZDSX":
                    p.setZDSX(Integer.parseInt(data.getParNum()));
                    break;
                case "JDSX":
                    p.setJDSX(Integer.parseInt(data.getParNum()));
                    break;
                default:
                    break;
            }
        }
        return p;
    }
}